from config.model_config import model,api_key,temperature,base_url
from langchain_openai import ChatOpenAI
class Model:
    """

大模型类，单例模式生成大模型实例。

    """
    llm: object

    def __init__(self, llm):
        self.llm = llm

    def to_dict(self):
        return {
            "llm": self.llm
        }

model = Model(ChatOpenAI(model=model, temperature=temperature, api_key=api_key, base_url=base_url, max_tokens=2048))
single_llm = model.llm
# print(single_llm.invoke("你是谁？").content)
